Hey guys! I came across the project today and I'm ...
# general
r
Hey guys! I came across the project today and I'm excited by what you're doing. I've never spoken to a company that's actually happy with their EHR. Eventually, the conversation drifts into "let's find a new one" or (usually) worse, "let's build our own". OS makes a lot of sense here. I'd be interested in getting involved! I checked the contributor guide and don't see any tickets marked as "good first issue" yet. Any plans on publishing a roadmap or more of a dev wishlist?
r
Fantastic to meet you @rickyk4504 . We would love to have your help. We are still working on getting some "Good first issues" up on the repository - sorry we don't have those yet. Are there any areas you are particularly interested in working on?
r
I have the most expertise with iOS, Swift and I love working with HealthKit. Could be useful for an SDK or some integrations. With the core EMR, the "Vitals" part would be interesting. Especially thinking about how that gets populated from an RPM or connected health source
r
One of the most valuable things for our community is having sample apps that show how to use the Medplum infrastructure for different applications. If you wanted to contribute a simple example RPM app using HealthKit, that would be 🔥 🔥 🔥 ! We could help you model your data the right way for FHIR / medplum, and help with any auth / infra issues.
Some other example apps we've done: - **Foo Medical**: An example patient portal (https://github.com/medplum/foomedical) - **Foo Provider**: An example provider portal for physician workflows (https://github.com/medplum/foomedical-provider) - **Medplum Hello World**: A simple react app for getting started (https://github.com/medplum/medplum-hello-world) - **OAuth Demo**: A one-file example for testing/debugging the OAuth2 Authentication Code flow (https://github.com/medplum/medplum-oauth-demo)
r
I like that idea! Thanks for the suggestion
r
Awesome! If you want to leverage our Typescript SDK (https://www.medplum.com/docs/sdk), feel free to prototype as a mobile web page first. We have a lot of helper functions that make dealing with the FHIR API a bit easier. But if you want to dive headfirst into Swift + IOS, be my guest.
Some additional resources: - For a brief primer on the FHIR standard, check out our FHIR Basics Page (https://www.medplum.com/docs/fhir-basics) - The main FHIR Resource you're going to use for Vitals is an
Observation
(https://www.medplum.com/docs/api/fhir/resources/observation) - The
subject
will be the Patient - the
code
will be the type of vital sign you're recording - you'll use
valueQuantity
for recording numerical values - You can see some example data in our "mock" package (https://github.com/medplum/medplum/blob/b96c2fdde914ec9099ccc27d344d7ef63bba7c44/packages/mock/src/mocks/simpsons.ts) - Our tutorials show how to create Observations and put them into reports. These are tailored to a lab use case, but could easily be modified for RPM (https://www.medplum.com/docs/tutorials/api-basics/create-fhir-data).
r
Helpful! Thanks for sending these over
Hey team! Wanted to show some signs of life here https://github.com/rkirkendall/medplum-healthkit - Implemented HealthKit auth and queries in an iOS app that pulls samples from the health store, starting with simple step count for now - WIP Exploring the use of this package for FHIR Observer object serialization. Not working yet: https://github.com/microsoft/healthkit-to-fhir - Once I get FHIR objects coming out, I'll start tying into the MP API
(I'm out this week coming but will continue to move this forward as I get time)
r
This is amazing! I wasn't aware of the healthkit-to-fhir library. I really like how it codes up all your observations with LOINC codes
Let us know how we can best support. We can give you some pointers on how to model the rest of your data in FHIR, or even taking the app for a test drive. Would also love to feature it to the community 🙂
r
This is amazing @rickyk4504 !
r
Thanks for the support and congrats on the v1 launch! Was out last week on my honeymoon (beautiful Fiji pic attached) Ready to pick this up again and get it over the finish line
r
Congratulations!!
And thank you for sending us this beautiful pic - I hope you guys had a blast
r
Some updates: - I cloned medplum and was able to get it built and running locally no problem (awesome job on the docs) - I've followed the examples you posted @rahul1 to get a test patient, service request and a diagnostic report set up to associate new observations with - Updated the iOS client to make authenticated API calls using a bearer token I manually copy over from the web app just to get stuff coming through - Modified the observations coming from healthkit to include refs to the service request and test pt per the example:
Copy code
let obs = try fhirFactory?.observation(from: sample)
obs?.status = .final
let serviceReqRef = Reference()
serviceReqRef.reference = "ServiceRequest/2daad37c-fec8-4467-8424-d6cd18cae436"
obs?.basedOn = [serviceReqRef]
let ptRef = Reference()
ptRef.reference = "Patient/56799d75-b773-4f83-b4ac-ffc47fe982c8"                                  
obs?.subject = ptRef
- I think it's almost working — medplum API returns 201s after I post observations and they look successful. However I don't see any observations associated with the service request in the UI
Any ideas why the observations aren't showing in the web client? Maybe I'm not forming the reference strings correctly?
r
Happy to help! Which page in the Medplum App are you looking at to see the Observations associated with the ServiceRequest?
r
I expected to see them in the details tab of the service request? Or maybe the diagnostic report that references the the service request
r
Got it. So a couple ideas here: 1. The "Details" tab of the service request only shows the properties of the ServiceRequest itself. It's basically a rendered view of the "JSON" tab. In general, we've found developers find the "JSON" tab more helpful since it shows the complete resource data. 2. The weird FHIR thing is that the Observations reference the ServiceRequest, not the other way around. (Observation.basedOn -> ServiceRequest instead of ServiceRequest -> Observation). That means the pointer would show up on the Observation's details page. 3. This is not super obvious in the Web App, but you can view any resource type, not just the types in the sidebar, by navigating to https://app.medplum.com/:resourceType (e.x. https://app.medplum.com/Observation). Try that to see if you can see you Observations
For the Diagnostic report, you'd to make sure that you've set the
DiagnosticReport.result
property to be an array of points to your
Observations
.
Also, i'm happy to hop into your project to help debug if you're comfortable inviting me
Another idea: how are you getting the ids of your Service request?
"ServiceRequest/2daad37c-fec8-4467-8424-d6cd18cae436"
. It's not super obvious from the docs, but the server assigns ids when you create a resources. So even if you send up a specific ID when you create the resource, the server will assign it's own - helps ensure uniqueness that way
r
I checked the id from the resource in the web app and used that
Okay, looks like it's working when I visit the /observations endpoint of the web app!
r
Got it, just checking 🙂
r
r
Nice! Looking good
r
Yes! I think we're in business on getting samples out of healthkit -> fhir obseravtions -> medplum db via POSTs. I can add some docs on my repo to make it more friendly as an example project!
r
That would be amazing! I'm a bit of an iOS n00b myself. Is this something I could test on my actual phone?
r
Yes! you'll need a paid iOS dev account (~$100 USD /yr I think) and Xcode. At that point you can run it on your device
if you just want to see it in action you can run it on the simulator and manually add data to the health app
I'll make a loom walkthrough video too
r
OMG you are a boss!
r
I'll post back once the repo readme and loom video is up. We can tweak it to make it fit in wherever it works best for ya'll
Would love to hop on a quick call and meet the team at some point 🙂
r
Was just thinking the same thing. We'd love to get to know you a bit better
Do you have time this Thursday? Otherwise we can do next week. Don't need to overwhelm you on the week you're back from your honeymoon
r
Yeah Thursday is pretty flex for me. How's 11AM Pacific?
r
r
Closing this out. Updated the repo with a full README and a Loom demo video that shows the project in action: https://github.com/rkirkendall/medplum-healthkit https://www.loom.com/share/e7e029754d9e46719c753ebe2bf6f062
r
This is great! Looking forward to chatting in a few
333 Views